package foundation.the_number_of_law;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * 输入12 3456 7009时，会给出相应的念法：
 * 　　十二亿三千四百五十六万七千零九
 * 　　用汉语拼音表示为
 * 　　shi er yi san qian si bai wu shi liu wan qi qian ling jiu
 * 　　这样他只需要照着念就可以了。
 * 　　你的任务是帮他设计这样一个系统：给定一个阿拉伯数字串，你帮他按照中文读写的规范转为汉语拼音字串，相邻的两个音节用一个空格符格开。
 * 　　注意必须严格按照规范，比如说“10010”读作“yi wan ling yi shi”而不是“yi wan ling shi”，“100000”读作“shi wan”而不是“yi shi wan”，
 *    “2000”读作“er qian”而不是“liang qian”。
 */
public class Main {
    static Map<Integer, String> map = new HashMap<Integer, String>() {{
        put(0, "ling");
        put(1, "yi");
        put(2, "er");
        put(3, "san");
        put(4, "si");
        put(5, "wu");
        put(6, "liu");
        put(7, "qi");
        put(8, "ba");
        put(9, "jiu");
        put(10, "shi");
    }};

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int wei = getWei(n);
        StringBuilder str = new StringBuilder();
        if (wei > 8) {
            int yi = n / 100000000;
            str.append(getStr(yi, getWei(yi)) + "yi" + " ");
        }
        if (wei > 4) {
            int wan = n / 10000 % 10000;
            int wW = getWei(wan);
            if (wan < 1000 && wei > 8) {
                str.append("ling" + " ");
            }
            str.append(getStr(wan, wW) + "wan" + " ");
        }
        int q = n % 10000;
        if (q < 1000 && q > 0 && wei > 4) {
            str.append("ling" + " ");
        }
        str.append(getStr(q, getWei(q)));
        System.out.println(str.toString());
    }

    public static StringBuilder getStr(int n, int wei) {
        StringBuilder str = new StringBuilder();
        if (n <= 10) {
            if (n == 10 && wei > 2) {
                str.append("yi shi ");
            } else if (n != 0) {
                str.append(map.get(n) + " ");
            }
        } else if (n < 100) {
            // 十位
            int shi = n / 10;
            if (shi != 0) {
                if (shi > 1) {
                    str.append(map.get(shi) + " ");
                }
                str.append("shi" + " ");
            } else {
                str.append("ling" + " ");
            }
            str.append(getStr(n - shi * 10, wei));
        } else if (n < 1000) {
            // 百位
            int bai = n / 100;
            if (bai == 0) {
                String tmp = "" + (n - bai * 100);
                int i = 0;
                char c = tmp.charAt(i);
                while (i + 1 < tmp.length() - 1 && Character.getNumericValue(c) == 0) {
                    i ++;
                    c = tmp.charAt(i);
                }
                // 找到第一个不为0的位
                if (i < tmp.length()) {
                    str.append("ling" + " ");
                    int t = Integer.parseInt(tmp.substring(i, tmp.length()));
                    str.append(getStr(t, wei));
                }
            } else {
                str.append(map.get(bai) + " " + "bai" + " ");
                int shi = n - bai * 100;
                if (shi > 0 && shi < 10) {
                    str.append("ling ");
                }
                str.append(getStr(shi, wei));
            }
        } else {
            // 千位
            int q = n / 1000;
            // 总位数大于9999
            if (q == 0 && wei > 4) {
                String tmp = "" + (n - q * 1000);
                int i = 0;
                char c = tmp.charAt(i);
                while (i + 1 < tmp.length() - 1 && Character.getNumericValue(c) == 0) {
                    i ++;
                    c = tmp.charAt(i);
                }
                // 找到第一个不为0的位
                if (i < tmp.length()) {
                    str.append("ling" + " ");
                    int t = Integer.parseInt(tmp.substring(i, tmp.length()));
                    str.append(getStr(t, wei));
                }
            } else {
                str.append(map.get(q) + " " + "qian" + " ");
                int bai = n - q * 1000;
                if (bai > 0 && bai < 100) {
                    str.append("ling ");
                }
                str.append(getStr(bai, wei));
            }
        }
        return str;
    }

    public static int getWei(int n) {
        int num = 0;
        // 获取位数
        while (n > 0) {
            num ++;
            n /= 10;
        }
        return num;
    }
}
